package nl.boelen.game.net.packet;


public class Packet11Leave extends Packet {

    private static final int packetNumber = 11;
    private String userName;
    private String uniqueKey;

    public Packet11Leave(byte[] data) {
        super(packetNumber);
        String[] datas = (readData(data)).split(":");
        this.userName = datas[0];
        this.uniqueKey = datas[1];
    }

    public Packet11Leave(String userName, String uniqueKey) {
        super(packetNumber);
        this.userName = userName;
        this.uniqueKey = uniqueKey;
    }

    @Override
    public byte[] getData() {
        return (packetNumber + this.userName + ":" + this.uniqueKey).getBytes();
    }

    public String getUsername() {
        return userName;
    }

    public String getUniqueKey() {
        return uniqueKey;
    }
}
